package com.javafactroy.kunlong.data.service;

import com.javafactroy.kunlong.data.dao.mysql.QueryConditionChildApiMapper;
import com.javafactroy.kunlong.data.entity.QueryConditionChildApiEntity;
import com.javafactroy.kunlong.data.dto.QueryConditionChildApiDto;
import com.javafactroy.kunlong.base.dto.TQueryParam;
import com.javafactroy.kunlong.base.model.ReturnPageInfo;

import org.apache.ibatis.annotations.Param;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
*  @author raymond.lei@163.com
*  @date   2023-12-04 14:10:20

*/
@Slf4j
@Service
public class QueryConditionChildApiService extends ApiService<QueryConditionChildApiDto, QueryConditionChildApiEntity, QueryConditionChildApiMapper> {

    public QueryConditionChildApiService() {
        init();

    }

    void init() {
        iquerySome = (QueryConditionChildApiDto dto) -> {
        };

        iquerySomeList = (List<QueryConditionChildApiDto> list) -> {
            list.forEach(i -> iquerySome.querySome(i));
        };
    }

    public ReturnPageInfo<QueryConditionChildApiDto> queryParam(@Param("queryParam") TQueryParam<QueryConditionChildApiDto> queryParam) {
        if ( queryParam.getParam() == null ) {
            queryParam.setParam(new QueryConditionChildApiDto());
        }

        return super.queryParam(queryParam);

    }

   /* public int save(QueryConditionChildApiDto entity) {
        if (entity.getid == null) {
            return super.insert(entity);
        }
        return super.update(entity);
    }*/

}
